Embodiments of the inventive subject matter generally relate to the field of computers, and, more particularly, to handling of signal interrupts in a transactional memory system.
Systems with transactional memory include atomic transactions to allow for concurrent execution of multiple threads of a program or programs. An atomic transaction can be defined as a transaction that is precluded from containing operations that can be detected external to the transaction. Problems can arise when handling signal interrupts during execution of an atomic operation. For example, an interrupt handler for a signal interrupt can contain operations that can be detected external to the current atomic transaction being processed at the point when the signal interrupt is received. Examples of operations detectable external to an atomic transaction can include accesses to atomic objects, memory lock acquisitions and releases, etc. Such operations by the handler would be in violation of the definition of an atomic transaction.
There are a number of insufficient approaches to processing a signal interrupt that is received during an atomic transaction. For a first conventional approach, the signal interrupt causes the atomic transaction to abort. The interrupt handler is processed and then the atomic transaction is retried. This first conventional approach is viable for systems that permit atomic transactions to be aborted and retried. However, such approach can starve atomic transactions from completion for a system have frequent signal interrupts.
For a second conventional approach, the signal is allowed to interrupt the atomic transaction. This approach can delay the atomic transaction, thereby making the atomic transaction more prone to conflicts and resulting in aborts, rollbacks, and retries. Also (as described above), some interrupt handlers might contain operation that are illegal within atomic transactions.
For a third conventional approach, signals are blocked across all atomic transactions. Such approach can be problematic because of the system calls needed to block signals can be the computational expensive on some platforms. Also, an atomic transaction containing an infinite loop can block signal interrupts indefinitely. Such situation may cause great frustration for users attempting to send a signal interrupt to regain control of a program (e.g., control-C, control-Z, etc.).